<template>
	<view class="contractSign">
		<web-view :src="webView.src"></web-view>
	</view>
</template>
<script>

	let that,eventChannel
	import {
		mapGetters,
		mapMutations
	} from 'vuex'
	export default {
		components:{},
		computed: {
			...mapGetters(['userInfo', 'api']),
		},
		props: {},
		data() {
			return {
				webView:{
					src:'',
					//要请求的api
					api:{},
					token:'',
					enterpriseApplicationId:'',
					baseUrl:uni.getStorageSync('baseUrl'),
				}
			}
		},
		onLoad(op) {
      uni.setNavigationBarTitle({title: this.$t('合同签署')})
			that = this
			eventChannel = this.getOpenerEventChannel();
			eventChannel.on('pagePramas',(data)=>{
				this.processingData(data)
			})

		},
		onShow() {},
		methods: {
			processingData(data){
				this.webView.api={
					GLOBAL_electronic_enterprise_contract_find:this.api.GLOBAL_electronic_enterprise_contract_find,//{id}企业合同详情
					GLOBAL_electronic_enterprise_contract_save:this.api.GLOBAL_electronic_enterprise_contract_save,//保存
					GLOBAL_electronic_message_authenticationCode_sendSMSAuthenticationCode:this.api.GLOBAL_electronic_message_authenticationCode_sendSMSAuthenticationCode,//发送短信验证码
					GLOBAL_electronic_message_authenticationCode_verifySMSAuthenticationCode:this.api.GLOBAL_electronic_message_authenticationCode_verifySMSAuthenticationCode,//确认短信验证码
					GLOBAL_owner_application_sign:this.api.GLOBAL_owner_application_sign,//签署
					GLOBAL_electronic_enterprise_application_applyCaAuthorized:this.api.GLOBAL_electronic_enterprise_application_applyCaAuthorized,//请求CA授权
					GLOBAL_electronic_enterprise_application_findAuthorized:this.api.GLOBAL_electronic_enterprise_application_findAuthorized,//查询企业申请单授权状态
					GLOBAL_device_signet_findDeviceInfo:this.api.GLOBAL_device_signet_findDeviceInfo,//获取设备在线状态
				}
				// this.webView.enterpriseApplicationId='134bad19-aa07-4595-a733-c8c54da572b4'
				this.webView.enterpriseApplicationId=data.enterpriseApplicationId //134bad19-aa07-4595-a733-c8c54da572b4
				this.webView.token=this.userInfo.token
				this.webView.src='/hybrid/html/pages/contractSign.html?data='+encodeURIComponent(JSON.stringify(this.webView))
			}
		}

	}
</script>

<style lang="scss">
	.contractSign{

	}
</style>
